/*
 * @Description:
 * @FilePath: \rs_wms_pc\src\api\invoice\scrap.js
 */
import request from '@/utils/request'

// 查询报废单列表
export function listScrap(query) {
  return request({
    url: '/bill/scrap/list',
    method: 'get',
    params: query
  })
}

// 查询报废单详细
export function getScrap(id) {
  return request({
    url: '/bill/scrap/' + id,
    method: 'get'
  })
}

// 新增报废单
export function addScrap(data) {
  return request({
    url: '/bill/scrap',
    method: 'post',
    data: data
  })
}

// 修改报废单
export function updateScrap(data) {
  return request({
    url: '/bill/scrap',
    method: 'put',
    data: data
  })
}

// 删除报废单
export function delScrap(id) {
  return request({
    url: '/bill/scrap/' + id,
    method: 'delete'
  })
}

// 取消报废单
export function cancelScrap(data) {
    return request({
      url: '/bill/scrap/cancel',
      method: 'put',
      data: data
    })
  }

// 确认取消报废单
export function confirmCancelScrap(data) {
    return request({
      url: '/bill/scrap/confirmCancel',
      method: 'put',
      data: data
    })
  }


// 查询报废单明细列表
export function listScrapDetail(query) {
  return request({
    url: '/bill/scrapDetail/list',
    method: 'get',
    params: query
  })
}

// 查询报废单明细详细
export function getScrapDetail(id) {
  return request({
    url: '/bill/scrapDetail/' + id,
    method: 'get'
  })
}

// 新增报废单明细
export function addScrapDetail(data) {
  return request({
    url: '/bill/scrapDetail',
    method: 'post',
    data: data
  })
}

// 修改报废单明细
export function updateScrapDetail(data) {
  return request({
    url: '/bill/scrapDetail',
    method: 'put',
    data: data
  })
}

// 删除报废单明细
export function delScrapDetail(id) {
  return request({
    url: '/bill/scrapDetail/' + id,
    method: 'delete'
  })
}
